<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">

            {foreach name="statusList" id="vo" key="k"}
                {eq name="row['status']" value="$k"}<p style="padding-top: 7px;">{$vo}</p>{/eq}
            {/foreach}
        </div>
    </div>
	
	{if condition="$row['status'] eq 7"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('撤单原因')}:</label>
        <div class="col-xs-12 col-sm-8">
            {$row.reason}
        </div>
    </div>
    {/if}
	
	{if condition = "$row['status'] eq 5 or $row['status'] eq 7"}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">挂单记录:</label>
        <div class="col-xs-12 col-sm-8">
            {foreach name="guadan_list" id="vo" key="k"}
            <p style="padding-top: 7px;">管理员姓名：{$vo.admin_name}</p>
            <p style="padding-top: 7px;">挂单时间：{$vo.created_time}</p>
            <p style="padding-top: 7px;">{$vo.reason}</p>
            <span style="width:100px;">----------------------------------------------------------------------------------</span>
            {/foreach}
        </div>

    </div>
    {/if}

    {if condition="($row['status'] neq 1) and ($row['status'] neq 7) and ($row['status'] neq 5)"}
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('操作')}:</label>
            <div class="col-xs-12 col-sm-8">
                {if condition="($row['status'] eq 3) or ($row['status'] eq 2) or ($row['status'] eq 12)"}
                    {:build_radios('row[status]', ['4'=>__('挂单'),'5'=>__('完成'),'7'=>__('撤单')],$row.status)}
                    {elseif condition="$row['status'] eq 4"/}
                    {:build_radios('row[status]', ['5'=>__('完成'),'7'=>__('撤单')],$row.status)}
                    {elseif condition="$row['status'] eq 8"/}
                    {:build_radios('row[status]', ['5'=>__('完成'),'7'=>__('撤单')],$row.status)}
                    {elseif condition="$row['status'] eq 11"/}
                    {:build_radios('row[status]', ['5'=>__('完成'),'7'=>__('撤单')],$row.status)}
                    {else/}
                    {:build_radios('row[status]', ['7'=>__('撤单')],$row.status)}
                {/if}
                <div style="color: #999;margin-top: 14px;">Tip:已发货的订单，可以操作已完成。已支付未完成的订单，可以撤单，支付金额退回用户余额。</div>
            </div>
        </div>
        <div class="form-group away" style="display: none;">
            <label class="control-label col-xs-12 col-sm-2">{:__('撤单方')}:</label>
            <div class="col-xs-12 col-sm-8">
                {:build_radios('row[away]', ['1'=>__('买家'),'2'=>__('卖家')],1)}
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea id="c-reason" class="form-control editor" rows="5" name="row[reason]" cols="50">{$row.reason|htmlentities}</textarea>
            </div>
        </div>

    {/if}

    <input id="c-id" class="form-control" name="row[id]]" type="hidden" value="{$row.id|htmlentities}">
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>

</form>
